package com.jnevision.overtime.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jnevision.common.CommonQuery;
import com.jnevision.overtime.model.Overtime;
import com.jnevision.overtime.model.OvertimeVO;

import io.lettuce.core.dynamic.annotation.Param;

/**
 * <p>
 * 加班申请 Mapper 接口
 * </p>
 *
 * @author gavin
 * @since 2019-07-14
 */
@Mapper
public interface OvertimeMapper extends BaseMapper<Overtime> {

    OvertimeVO getApproveDetail(String overtimeRecordId);

    List<OvertimeVO> getApprove(String userId);

    Float getRestTime(Map<String, String> map);

    IPage<OvertimeVO> page(Page<OvertimeVO> page, @Param("commonQuery") CommonQuery commonQuery,
        @Param("result") Integer result);

    String overtimeDuration(CommonQuery query);

    List<Overtime> overtimeSlot(CommonQuery query);

    IPage<OvertimeVO> getRecordsByUser(Page<OvertimeVO> page, @Param("userId") String userId);
}
